<html>
<head><meta charset="utf-8"><title>Question · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Question.html">Question</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="182656123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Question/near/182656123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Question.html#182656123">(Dec 05 2019 at 12:54)</a>:</h4>
<p>Is it possible to express the following trait system query under chalk?</p>
<p>compatible(T, U) is "satisfied" if there exists a type sequence <code>[U_0, U_1, ..., U_N]</code> such that for <code>i</code> in range <code>[1, N)</code> the query <code>compatible(U_{i}, U_{i+1})</code> is satisfied and such that <code>compatible(U_N, U)</code>is also satisfied</p>
<p>?</p>



<a name="182681528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Question/near/182681528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Question.html#182681528">(Dec 05 2019 at 17:18)</a>:</h4>
<p>Context: <a href="https://gist.github.com/gnzlbg/4ee5a49cc3053d8d20fddb04bc546000#reference-level-explanation" target="_blank" title="https://gist.github.com/gnzlbg/4ee5a49cc3053d8d20fddb04bc546000#reference-level-explanation">https://gist.github.com/gnzlbg/4ee5a49cc3053d8d20fddb04bc546000#reference-level-explanation</a> (in particular, the last paragraph of that section).</p>



<a name="182816867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Question/near/182816867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Question.html#182816867">(Dec 06 2019 at 23:56)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> ..maybe?</p>



<a name="182816879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Question/near/182816879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Question.html#182816879">(Dec 06 2019 at 23:56)</a>:</h4>
<p>/me reads context</p>



<a name="182816885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Question/near/182816885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Question.html#182816885">(Dec 06 2019 at 23:56)</a>:</h4>
<p>Yeah I'm going with "maybe" :)</p>



<a name="182816895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Question/near/182816895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Question.html#182816895">(Dec 06 2019 at 23:57)</a>:</h4>
<p>it certainly seems expressible but also seems fairly dissimilar from other things in Rust</p>



<a name="182816912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Question/near/182816912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Question.html#182816912">(Dec 06 2019 at 23:57)</a>:</h4>
<p>that said, chalk can certainly express things like the "at least one" solution (via <code>exists&lt;T&gt; { ... }</code> goals). I'm not sure about the open-ended nature of the length of the sequence though.</p>



<a name="183174912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Question/near/183174912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Question.html#183174912">(Dec 11 2019 at 16:37)</a>:</h4>
<p>thanks, I'll try to get chalk running and see if I can find a way to express the query</p>



<a name="183177281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Question/near/183177281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Question.html#183177281">(Dec 11 2019 at 17:00)</a>:</h4>
<p>(this explanation might be clearer expressed as the <code>compatible</code> transitive closure in datalog: <code>compatible(T, U) :- compatible(T, X), compatible(X, U).</code>)</p>



<a name="183359554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Question/near/183359554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Question.html#183359554">(Dec 13 2019 at 13:42)</a>:</h4>
<p><span class="user-mention" data-user-id="124289">@rkruppe</span> ^^^</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>